﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SWSP.Management.ServerObjects
{
    public abstract class Server
    {
        #region Ctor

        public Server(string serverName, string userName, string password)
        { }

        #endregion

        #region Public Properties

        /// <summary>
        /// Server type enumeration.
        /// </summary>
        public enum ServerType { SqlServer, OracleServer, MySqlServer };

        /// <summary>
        /// Get the server name.
        /// </summary>
        public string Name
        { get; internal set; }
        
        /// <summary>
        /// Get the server engine version.
        /// </summary>
        public string Version
        { get; internal set; }

        /// <summary>
        /// Get the current connection string information.
        /// </summary>
        public string ConnectionString
        { get; internal set; }

        /// <summary>
        /// Get or set the server type (Oracle, Sql, MySql)
        /// </summary>
        public ServerType Type
        { get; internal set; }

        /// <summary>
        /// Get the server databases.
        /// </summary>
        public abstract List<Database> Databases
        { get; }

        /// <summary>
        /// Get the server databases with a specified index.
        /// </summary>
        /// <param name="index">position in array</param>
        /// <returns>Database</returns>
        public abstract Database this[int index]
        {
            get;
            set;
        }

        #endregion
    }
}
